package com.example.lotterysystem.controller.param;

import com.example.lotterysystem.common.enums.PrizeGradeEnum;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class ActivityCreateParam {

    @NotBlank(message = "活动名不能为空")
    private String activityName;

    @NotBlank(message = "活动描述不能为空")
    private String description;

    @NotNull(message = "活动关联奖品不能为空")
    @Valid
    private List<ActivityPrizeParam> activityPrizeList;

    @NotNull(message = "活动关联人员不能为空")
    @Valid
    private List<ActivityUserParam> activityUserList;

    /**
     * 活动关联的奖品
     */
    @Data
    public static class ActivityPrizeParam implements Serializable {
        @NotNull(message = "活动关联的奖品 id 不能为空")
        private Long prizeId;

        @NotNull(message = "活动关联的奖品数量不能为空")
        private Long prizeAmount;

        @NotBlank(message = "奖品等级不能为空")
        private String prizeTiers;
    }

    /**
     * 活动关联的人员
     */
    @Data
    public static class ActivityUserParam implements Serializable{
        @NotNull(message = "活动关联的人员 id 不能为空")
        private Long userId;

        @NotBlank(message = "人员姓名不能为空")
        private String userName;
    }
}
